package com.wang.openApiclientsdk.service.random;

import cn.hutool.http.HttpUtil;
import com.wang.openApiclientsdk.common.HttpConstant;

import java.util.HashMap;
import java.util.Map;

/**
 * 随机数
 */
public class RandomService {

    private final Map<String, String> addressMap = new HashMap();

    {
        addressMap.put("getRandomByGet", "/random/get");
        addressMap.put("getRandomByGet_length", "/random/getByLength");
    }

    public String getRandomByGet() {
        return HttpUtil.get(HttpConstant.prefix + addressMap.get("getRandomByGet"));
    }

    public String getRandomLengthByGet(String length) {
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("length", length);
        return HttpUtil.get(HttpConstant.prefix + addressMap.get("getRandomByGet_length"), hashMap);
    }
}
